package cn.iocoder.yudao.module.blog.controller.app.manager;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.blog.service.manager.BlogManagerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Tag(name = "管理后台 - 论坛管理员名单")
@RestController
@RequestMapping("/blog/manager")
@Validated
public class AppBlogManagerController {

    @Resource
    private BlogManagerService managerService;

    @GetMapping("/get")
    @Operation(summary = "查看member 是否是管理员")
    @Parameter(name = "memberId", description = "编号", required = true, example = "1024")
    public CommonResult<Boolean> isManager(@RequestParam("memberId") Long memberId){
        return CommonResult.success(managerService.isManager(memberId));
    }
}
